VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmToolsLibrary 
   BackColor       =   &H00FFFFFF&
   Caption         =   "Library"
   ClientHeight    =   6255
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   3330
   ControlBox      =   0   'False
   ForeColor       =   &H00000000&
   Icon            =   "frmToolsLibrary.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   6255
   ScaleWidth      =   3330
   StartUpPosition =   3  'Windows Default
   Begin MSComctlLib.ImageList imgApp 
      Left            =   3795
      Top             =   660
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   6
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmToolsLibrary.frx":0A02
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmToolsLibrary.frx":1414
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmToolsLibrary.frx":1E26
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmToolsLibrary.frx":2838
            Key             =   "Reports"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmToolsLibrary.frx":324A
            Key             =   "Settings"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmToolsLibrary.frx":3C5C
            Key             =   "Others"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.TabStrip tsLibrary 
      Height          =   360
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   3315
      _ExtentX        =   5847
      _ExtentY        =   635
      Style           =   1
      ImageList       =   "imgApp"
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   3
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Operation"
            ImageVarType    =   2
            ImageIndex      =   3
         EndProperty
         BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Reports"
            ImageVarType    =   2
            ImageIndex      =   4
         EndProperty
         BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Settings"
            ImageVarType    =   2
            ImageIndex      =   5
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSComctlLib.TreeView tvLibrary 
      Height          =   2475
      Left            =   300
      TabIndex        =   1
      Top             =   1035
      Width           =   2370
      _ExtentX        =   4180
      _ExtentY        =   4366
      _Version        =   393217
      Indentation     =   265
      LabelEdit       =   1
      Style           =   7
      FullRowSelect   =   -1  'True
      Appearance      =   0
   End
End
Attribute VB_Name = "frmToolsLibrary"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsLib As New Recordset

Private Sub Form_Activate()
    Form_Resize
End Sub

Private Sub Form_Load()
    sUserRole = "SUPERUSER"
    ReadConnection frmToolLogin.txtServerName, frmToolLogin.txtDataSourceName, frmToolLogin.txtDatabaseName, frmToolLogin.txtPassword
    tsLibrary_Click
End Sub

Private Sub Form_Resize()
    tsLibrary.Move 0, 0, Me.ScaleWidth
    With tvLibrary
        .Left = 100
        .Top = tsLibrary.Top + tsLibrary.Height
        .Width = Me.ScaleWidth - 100
        .Height = Me.ScaleHeight - tsLibrary.Height
    End With
End Sub

Private Sub tsLibrary_Click()
    If rsLib.State = 1 Then rsLib.Close
    rsLib.Open "se_LibraryList '" & sUserRole & "','" & tsLibrary.SelectedItem.Caption & "'", cn, adOpenStatic, adLockReadOnly
    AddTVNode tvLibrary, imgApp, rsLib
End Sub

Private Sub tvLibrary_DblClick()
    LinkForms tvLibrary.SelectedItem.Key
    LoadDynamicForm FrmName, MiniERPMain.Workspace
    MainTab Add
End Sub
